/*
 * example.c
 *
 *  Created on: 2021年7月17日
 *      Author: dbw
 */

#include "common.h"

#define LOG_TAG     "example_log"
#define LOG_LEVEL    LOG_LEVEL_VERBOSE
#include "logger.h"

#include "examples.h"

#ifdef EXAMPLE_SHOW_LOG

void log_example_run(void)
{
    const char *hex = "01234567890";

    LOG_V("this is a verbose log");
    sys_delay(10);
    LOG_D("this is a debug log");
    sys_delay(10);
    LOG_I("this is a info log");
    sys_delay(10);
    LOG_W("this is a warning log");
    sys_delay(10);
    LOG_E("this is a error log");
    sys_delay(10);
    LOG_F("this is a fatal log");

    LOG_I("print formula: %d + %d = %d", 10, 20, 10 + 20);

    LOG_HEX_V(hex, strlen(hex), "this is a verbose dump");
    LOG_HEX_E(hex, strlen(hex), "this is a error dump");
}

#else

void log_example_run(void)
{

}

#endif /* EXAMPLE_SHOW_LOG */
